<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    body {
      background-color: #000;
    }

    .banner {
      height: 500px;
      border: #f00 1px solid;
      margin: 10px;
    }

    .phone {
      background-color: black;
    }

    @media (min-width: 1024px) {
      .phone .title {
        position: relative;
        color: white;
        width: 250px;
        --gradient-progress-2: 0%;
        --gradient-progress: -100%;
      }

      .phone .title::after {
        content: " ";
        display: block;
        position: absolute;
        height: 110%;
        width: 100%;
        top: 0;
        left: 0;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0) var(--gradient-progress),
            #000 var(--gradient-progress-2));
      }

      .phone .img-box {
        opacity: 0;
      }
    }

    @media (max-width: 1024px) {
      .phone .title {
        transform: translate(0, 20vh);
        opacity: 0;
        color: white;
      }

      .phone .img-box {
        transform: translate(0, 20vh);
        opacity: 0;
      }

      .phone .img-box img {
        width: 80%;
      }
    }
  </style>
</head>

<body>
  <div class="banner"></div>
  <div class="banner"></div>

  <center>
    <div class="phone">
      <div class="title">
        <h2>65W SuperVOOC 2.0</h2>
      </div>
      <div class="img-box">
        <img src="http://localhost:8080/cn/assets//src/components/product/kunlun/fastCharging/assets//fast1x.png"
          alt="">
      </div>
    </div>
  </center>
  <div class="banner"></div>
  <div class="banner"></div>
  <script>
    gsap.registerPlugin(ScrollTrigger);
    if (screen.width >= 1024) {
      gsap.to('.phone .img-box', {
        scrollTrigger: {
          trigger: '.phone .img-box',
          start: 'top 60%',
          ease: 'ease-out',
          end: 'center center',
          toggleActions: 'restart pause reverse none',
          // markers: true,
          scrub: 0.03
        },
        opacity: 1,
      });

      gsap.to('.phone .title', {
        scrollTrigger: {
          trigger: '.phone .title',
          start: 'top 60%',
          end: 'bottom 60%',
          toggleActions: 'restart pause reverse none',
          markers: true,
          scrub: 0.3
        },
        '--gradient-progress-2': '200%',
        '--gradient-progress': '100%'
      });
    } else {
      gsap.to('.phone .img-box', {
        scrollTrigger: {
          trigger: '.phone .img-box',
          start: 'top 80%',
          ease: 'ease-out',
          end: 'center center',
          toggleActions: 'restart pause reverse none',
          // markers: true,
          scrub: 0.03
        },
        opacity: 1,
        transform: `translate(0, 0vh)`
      });

      gsap.to('.phone .title', {
        scrollTrigger: {
          trigger: '.phone .title',
          start: 'top 80%',
          end: 'bottom 60%',
          toggleActions: 'restart pause reverse none',
          markers: true,
          scrub: 0.03
        },
        opacity: 1,
        transform: `translate(0, 0vh)`
      });
    }


  </script>
</body>

</html>